package shop.up.common.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * 线程池 {@link ThreadPoolConfig}
 *
 * @author Kevin
 * @date 2022/7/18
 */
@Configuration
public class ThreadPoolConfig {

    @Bean
    public ThreadPoolExecutor getThreadPoolExecutor(){
        return new ThreadPoolExecutor(
                10,
                100,
                30, TimeUnit.SECONDS,
                new ArrayBlockingQueue<>(1000));
    }
}
